package com.hzit.pay.web.iClient;

import com.hzit.pay.web.iClient.impl.AliapyFrontClientImpl;
import com.hzit.payweb.api.alipay.AliapyQrCodeReq;
import com.hzit.payweb.api.alipay.AlipayH5Req;
import com.hzit.payweb.api.resp.PayFrontRespData;
import com.hzit.payweb.api.resp.RespVo;
import com.hzit.payweb.api.resp.data.PayQueryRespData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 调用支付宝前置服务
 */
@FeignClient(value = "ALIPAY-FRONT",fallback = AliapyFrontClientImpl.class)
public interface IAliapyFrontClient {

    /**
     * 支付宝扫码支付接口
     * @return
     */
    @RequestMapping("/alipay/qrCodePay")
    public RespVo<PayFrontRespData> alipayQrCodePay(@RequestBody AliapyQrCodeReq aliapyQrCodeReq);


    /**
     * 支付宝H5支付
     * @return
     */
    @RequestMapping("/alipay/h5Pay")
    public RespVo<PayFrontRespData> alipayH5Pay(@RequestBody AlipayH5Req alipayH5Req);



    /**
     * 支付宝H5支付
     * @return
     */
    @RequestMapping("/alipay/singleQuery")
    public  RespVo<PayQueryRespData> tradeSingleQuery(@RequestParam("outTradeNo") String outTradeNo,
                                                      @RequestParam("tradeNo") String tradeNo);


    /**
     * 支付宝退款接口
     * @return
     */
    public RespVo alipayRefundAmt(@RequestParam("outTradeNo") String outTradeNo,
                                  @RequestParam("refundAmount") String refundAmount,
                                  @RequestParam("refundSerialNo") String refundSerialNo);

}
